using System;

namespace OpenWaves.Caching
{
    public static class LockManagerExtensions
    {
        public static void AcquireLock(this ILockManager lockManager, string key)
        {
            lockManager.TryAcquireLock(key, TimeSpan.MaxValue);
        }

        public static bool TryAcquireLock(this ILockManager lockManager, string key)
        {
            return lockManager.TryAcquireLock(key, TimeSpan.Zero);
        }
    }
}